package experimentation;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

import poi.Info.Location;

import agent.Context.Context;

public class MainSurprise {


	
	public static void requestPOIs() {	
		int radius=300;
		try {
			BufferedReader file = new BufferedReader(new FileReader("DB/TrainingDataset/t.txt"));

			String line="", timeOfDay="", dayOfWeek="", goal="";
			String[] str;
			double lat=0.0, lng=0.0;

			ArrayList<Context> contexts = new ArrayList<Context>();
			Context contextTemp=null;
			Location userLocation =null;
			
			int i=0;
			while ((line = file.readLine()) != null) {
				//The line contains:
				//lat,lng,timeOfDay,dayOfWeek,goal
				str = line.split(",");
				lat = Double.parseDouble(str[0].trim());
				lng = Double.parseDouble(str[1].trim());
				userLocation = new Location(lat, lng);
			
				timeOfDay = str[2];
				dayOfWeek = str[3];
				goal = str[4];

				contextTemp = new Context(userLocation, timeOfDay, dayOfWeek, goal, radius, ++i);
				contexts.add(contextTemp);
				System.out.println(contextTemp.toString());

			}

			file.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
	
	public static void main(String args[]) {
		requestPOIs();
	}
}
